home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 005 / tss15.arc / TSS.PRG < prev    next >
Encoding:
Text File  |  1986-06-25  |  9.3 KB  |  313 lines

  1. ************************************************************************
  2. *
  3. * TSS.PRG
  4. * Time Sheet System  version 1.5
  5. * Main menu   
  6. *
  7. * written by Allan J. Sieker
  8. *
  9. * uses procedure files TSSPROC.PRG, TSSREPT.PRG, TSSFUNCT.PRG
  10. * The BROW function emulates the dbase BROWSE function, see TSSFUNCT.PRG
  11. *
  12. * org 01/  /85 - for dB3
  13. * chg 08/  /85 - modified for Clipper
  14. * chg 03/15/86 - report title change and improved brow function
  15. * chg 03/25/86 - new clipper.lib (w85) has a larger memory requirement
  16. *                causing the archive selection to bomb on a 256K machine.
  17. *                Decided to shorten code instead of using overlays.
  18. *                Changed archive program to only archive one pay period
  19. *                and not archive both pay periods.
  20. *                Also dropped the monthly summary report.
  21. * chg 04/15/86 - add bell to respond to EOF() on support files during entry
  22. *                (to wake up Bernice when she has a data problem pending)
  23. * chg 06/02/86 - compiled and linked proc file to fix index problem 
  24. * chg 06/25/86 - changed TSSREPT.PRG and TSSPROC.PRG.
  25. *                changed report titles to come from TSSSTAT.DBF.
  26. *                changed structure of TSSSTAT.DBF - added fields:
  27. *                COMPANY_1,C,40
  28. *                COMPANY_2,C,40
  29. *
  30. *************************************************************************
  31. *************************************************************************
  32. *
  33. *   SPECIAL NOTE:
  34. *
  35. *   When compiling with Clipper w85 the following command sequence will 
  36. *   generate an assignment error:
  37. *
  38. *   IF CLIPPER
  39. *      DO BROW ..........
  40. *   ELSE
  41. *      BROWSE FIELDS ......
  42. *   ENDIF
  43. *
  44. *   This error is because Clipper does not recognize the BROWSE command.
  45. *   Ignore this error and continue with the linking. I haven't had any
  46. *   problems and I have been doing it since the summer of 1985.
  47. *
  48. *   The indicated SET commands below will not be recognized by Clipper.
  49. *   I have also ignored these errors without any problems.
  50. *
  51. *   If you are a worry-wart, then just remove the IF..ELSE..ENDIF altogether
  52. *   and end up with:
  53. *
  54. *   DO BROW .....
  55. *
  56. *   And just don't try to run it in dBase.
  57. *
  58. *************************************************************************
  59. *************************************************************************
  60. *
  61. *  Clipper compiling note:
  62. *
  63. *  I compiled each of the TSS modules individually so that I wouldn't need
  64. *  to do a full scale compile if I only changed one of the modules.
  65. *  The top level module requires a .CLP file so that all lower level
  66. *  modules won't be compiled.
  67. *
  68. *  TSS.CLP contains:
  69. *                        TSS
  70. *
  71. *  Compile: CLIPPER @TSS
  72. *           CLIPPER TSSFUNCT
  73. *           CLIPPER TSSPROC
  74. *           CLIPPER TSSREPT
  75. *
  76. *
  77. *
  78. *  Plink linking notes:
  79. *
  80. *  I used a .LNK file for linking.
  81. *
  82. *  TSS.LNK contains:
  83. *                        FI TSS
  84. *                        FI TSSFUNCT
  85. *                        FI TSSPROC
  86. *                        FI TSSREPT
  87. *                        LIB \DBASE\CLIPPER
  88. *
  89. *  Link: PLINK86 @TSS
  90. *
  91. *  Note:
  92. *  I have dBase and Clipper in a subdirectory called DBASE.
  93. *  
  94. *************************************************************************
  95. *************************************************************************
  96. *
  97. * init stuff for testing in dB3+
  98. *
  99. CLEAR ALL
  100. SET BELL OFF
  101. SET DELIM OFF
  102. SET DELETED ON
  103. SET TALK OFF
  104. SET SAFETY OFF
  105. SET PRINT OFF
  106. SET STATUS OFF         &&  Clipper will not recognize this
  107. SET HELP OFF           &&  Clipper will not recognize this
  108. SET MENU OFF
  109. SET DEVICE TO SCREEN
  110. *
  111. *************************************************************************
  112.  
  113. CLEAR
  114. TEXT
  115.      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░        ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░  
  116.      ▓░░░░░░░▓▓▓░░░░░░░▓░     ▓▓░░░░░░░░░░░░░▓▓░      ▓▓░░░░░░░░░░░░░▓▓░ 
  117.      ▓░      ▓▓▓░      ▓░    ▓▓▓░            ▓▓▓░    ▓▓▓░            ▓▓▓░
  118.              ▓▓▓░            ▓▓▓░                    ▓▓▓░                
  119.              ▓▓▓░            ▓▓▓░                    ▓▓▓░                 
  120.              ▓▓▓░            ▓▓▓░                    ▓▓▓░                
  121.              ▓▓▓░             ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░ 
  122.              ▓▓▓░              ░░░░░░░░░░░░░░▓▓▓░      ░░░░░░░░░░░░░░▓▓▓░
  123.              ▓▓▓░                            ▓▓▓░                    ▓▓▓░
  124.              ▓▓▓░                            ▓▓▓░                    ▓▓▓░
  125.              ▓▓▓░                            ▓▓▓░                    ▓▓▓░
  126.              ▓▓▓░            ▓▓▓░            ▓▓▓░    ▓▓▓░            ▓▓▓░
  127.              ▓▓▓░             ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░ 
  128.              ▓▓▓░               ░░░░░░░░░░░░░░░        ░░░░░░░░░░░░░░░░  
  129.   
  130.                             Time Sheet System (TSS)
  131.                                  Version  1.5
  132.                                    06/25/86
  133.                        Copyright (c) 1986 by A. J. Sieker
  134.   
  135.                     TSSDATA diskette is required in drive B:
  136.  
  137. ENDTEXT
  138.  
  139. PUBLIC SEL,P_WIDTH,ERROR,REPLY,BELL,CLIPPER
  140.  
  141. *************************************************************************
  142. *
  143. * everything declared here is treated as PUBLIC
  144. *
  145.  
  146.  
  147. * if you intend to run in just dBase only, change the macro drive
  148. * assignments to suit your needs.
  149. *
  150. IF CLIPPER
  151.    * target (compiled) installation is with diskette drives
  152.    *
  153.    A_DRIVE='A:'       &&  macro drive A: assignment = A:
  154.    B_DRIVE='B:'       &&  macro drive B: assignment = B:
  155.    NDX='.NTX'          &&  clipper indexes are used
  156.    DELAY=100
  157. ELSE
  158.    * testing (dbase) is on the hard disk
  159.    *
  160.    A_DRIVE='C:'       &&  macro drive A: assignment = C:
  161.    B_DRIVE='C:'       &&  macro drive B: assignment = C:
  162.    NDX='.NDX'          &&  dbase indexes are used
  163.    DELAY=20
  164. ENDIF
  165.  
  166. * define macro filenames
  167. *
  168. TSSINPUT=B_DRIVE+'TSSINPUT'
  169. TSSCONTR=A_DRIVE+'TSSCONTR'
  170. TSSDEPT=A_DRIVE+'TSSDEPT'
  171. TSSEMPL=A_DRIVE+'TSSEMPL'
  172. TSSENAME=A_DRIVE+'TSSENAME'
  173. TSSENMBR=A_DRIVE+'TSSENMBR'
  174. TSSRCTRL=A_DRIVE+'TSSRCTRL'
  175. TSSSTAT=A_DRIVE+'TSSSTAT'
  176. TSSF01=B_DRIVE+'TSSF01'
  177. TSSF01A=B_DRIVE+'TSSF01A'
  178. TSSF01B=B_DRIVE+'TSSF01B'
  179. TSSF01C=B_DRIVE+'TSSF01C'
  180. TSSF01D=B_DRIVE+'TSSF01D'
  181. TSSF02=B_DRIVE+'TSSF02'
  182.  
  183. BELL=CHR(7)
  184.  
  185. * open default procedure file
  186. *
  187. SET PROCEDURE TO TSSPROC
  188.  
  189. * verify required files are available
  190. *
  191. DO INITDBF
  192. IF ERROR
  193.    CLOSE DATA
  194.    CLOSE INDEX
  195.    RETURN
  196. ENDIF
  197.  
  198. SELECT E
  199. * get company titles for reports
  200. *
  201. CO_NAME_1=TRIM(COMPANY_1)      &&  company name
  202. CO_NAME_2=TRIM(COMPANY_2)      &&  division name
  203.  
  204. * set max printer width to value in status file
  205. *
  206. P_WIDTH=WIDTH
  207.  
  208. SELECT A
  209.  
  210. * file usage in normal mode - report section uses different files
  211. * A=Input data file (hours)   TSSINPUT  in drive B:
  212. * B=Master Employee file      TSSEMPL   in drive A:
  213. * C=Master Contract file      TSSCONTR  "
  214. * D=Master Department file    TSSDEPT   "
  215. * E=Status file               TSSSTAT   "
  216. * F=Report control file       TSSRCTRL  "
  217. * G=Temp. work area
  218. *
  219. SEL=' '
  220. DO WHILE SEL#'0'
  221.    SEL=' '
  222.    CLEAR
  223.    TEXT
  224.                    Time Sheet System Menu
  225.  
  226.    1.  Enter Time Sheets
  227.    2.  Edit Time Sheets
  228.    3.  Verify Input Data against Master Files
  229.  
  230.    4.  Payroll Reports (each pay period)
  231.    5   Archive Time Sheet Data
  232.    6.  Edit Report Contract List     
  233.  
  234.    7.  Edit Master Dept List
  235.    8.  Edit Master Employee List
  236.    9.  Edit Master Contract List
  237.  
  238.    R.  Regenerate File Indexes (Pack & Reindex)
  239.    S.  Status
  240.    M.  Maintenance (Time sheet input data only)
  241.  
  242.    0.  Exit Program
  243.  
  244.    ENDTEXT
  245.    @ 22,0 SAY 'Enter Selection ' GET SEL
  246.    READ
  247.    DO CASE
  248.       CASE SEL='1'
  249.            DO INPUT 
  250.       CASE SEL='2'
  251.            DO EDIT
  252.       CASE SEL='3'
  253.            DO VERIFY 
  254.       CASE SEL='4'
  255.            SET PROCEDURE TO TSSREPT
  256.            DO REPT 
  257.            SET PROCEDURE TO TSSPROC
  258.            DO INITDBF
  259.       CASE SEL='5'
  260.            DO ARCHIVE
  261.       CASE SEL='6'
  262.            DO REPTLIST
  263.       CASE SEL='7'
  264.            SELECT D
  265.            GOTO TOP
  266.            IF CLIPPER
  267.               DO BROW WITH 'DEPT','NAME',' ',' '
  268.            ELSE
  269.               BROWSE FIELDS DEPT,NAME
  270.            ENDIF
  271.            SELECT A
  272.       CASE SEL='8'
  273.            SELECT B
  274.            SET INDEX TO &TSSENAME,&TSSENMBR
  275.            GOTO TOP
  276.            IF CLIPPER
  277.               DO BROW WITH 'LAST_NAME','FIRST_NAME','EMPL_NO',' '
  278.            ELSE
  279.               BROWSE FIELDS LAST_NAME,FIRST_NAME,EMPL_NO
  280.            ENDIF
  281.            SET INDEX TO &TSSENMBR
  282.            GOTO TOP
  283.            SELECT A
  284.       CASE SEL='9'
  285.            SELECT C
  286.            GOTO TOP
  287.            IF CLIPPER
  288.               DO BROW WITH 'CONTRACT','NAME','HEAD',' '
  289.            ELSE
  290.               BROWSE FIELDS CONTRACT,NAME,HEAD
  291.            ENDIF
  292.            SELECT A
  293.       CASE SEL='R'
  294.            DO REGEN
  295.       CASE SEL='S'
  296.            DO STATUS
  297.       CASE SEL='M'
  298.            DO MAINT
  299.    ENDCASE
  300. ENDDO
  301. CLOSE DATA
  302. CLOSE INDEX
  303.  
  304. RETURN
  305. *
  306. ************************************************************************
  307. *************************************************************************
  308. *
  309. * end of file - TSS.PRG
  310. *
  311. *************************************************************************
  312.